package org.dudemonkey.jvm.concurrency.chp1dot3;

import org.dudemonkey.jvm.concurrency.util.PrintUtil;

public class SubThread extends Thread {

    private Object inlock;



    public SubThread() {
        this.inlock=null;
    }
    public SubThread(Object sharedObj) {
        super.setName("SubThread===>>>");
        this.inlock=sharedObj;
    }
    @Override
    public void run() {

            PrintUtil.sleep(2);

            synchronized (inlock){
                PrintUtil.sleep(5);

            }


    }
}
